package cn.com.sinosoft.exam.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.com.sinosoft.exam.dao.PatientMapper;
import cn.com.sinosoft.exam.model.Patient;
import cn.com.sinosoft.exam.page.PageParam;

/**
 * 
 * 患者管理逻辑处理类
 * @author xl
 *
 */
@Service
public class PatientService {
	
	@Autowired
	PatientMapper patientMapper;
	
	/**
     * 分页查询
     * @param params
     * @return
     */
    public PageInfo<Patient> page(Map<String,Object> params, PageParam pageParam) {
        return PageHelper.startPage(pageParam.getPage(), pageParam.getLimit())
        		.doSelectPageInfo(() -> patientMapper.page(params));
    }

}
